<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fun" uri="http://java.sun.com/jsp/jstl/functions"%>

<div class="data_list">
	  		<div class="data_list_title">
			<img src="${pageContext.request.contextPath}/static/images/list_icon.png"/>
			最新博客</div>
	  		
	  		<div class="datas">
	  			<ul>
	  				<c:forEach items="${pageBean.data }" var="blogExtend">
		  				<li style="margin-bottom: 30px">
		  					<span class="date"><a href="${pageContext.request.contextPath}/blog/show/${blogExtend.id }.html"><fmt:formatDate value="${blogExtend.releaseTime }" type="date" pattern="yyyy年MM月dd日"/></a></span>
						  	<span class="title"><a href="${pageContext.request.contextPath}/blog/show/${blogExtend.id }.html">${blogExtend.title }</a></span>
						  	<span class="summary">摘要: ${blogExtend.summary }...</span>
						  	<span class="img">
						  			<c:forEach items="${blogExtend.imagesList }" var="image">
								  		<a href="${pageContext.request.contextPath}/blog/show/${blogExtend.id }.html">${image }</a>
								  		&nbsp;&nbsp;
						  			</c:forEach>
						  	</span>
						  	<span class="info">发表于<fmt:formatDate value="${blogExtend.releaseTime }" type="date" pattern="yyyy年MM月dd日"/>阅读(${blogExtend.clickHit }) 评论(${blogExtend.replyHit }) </span>
		  					
		  				</li>
		  				 <hr style="height:5px;border:none;border-top:1px dashed gray;padding-bottom:  10px;" />
	  				</c:forEach>
	  			</ul>
	  		</div>
	  	</div>
	  	
	 <nav>
		 <ul class="pagination pagination-sm">
		 	<c:if test="${pageBean.totalPage == 0 }">
		 		<font color="#000"><strong>未查询到数据</strong></font>
		 	</c:if>
		 	
		 	<c:if test="${pageBean.totalPage > 0}">
			  	<li><a href="${pageContext.request.contextPath }/blog/list/pageNum/1.html?year=${param.year}&month=${param.month}&typeId=${param.typeId}">首页</a></li>
			 	
			 	<c:if test="${pageBean.pageNumber == 1 }">
			 		<li class="disabled"><a href="javascript:void(0)">上一页</a></li>
			 	</c:if>
			 	<c:if test="${pageBean.pageNumber != 1 }">
			 		<li><a href="${pageContext.request.contextPath }/blog/list/pageNum/${pageBean.pageNumber - 1 }.html?year=${param.year}&month=${param.month}&typeId=${param.typeId}">上一页</a></li>
			 	</c:if>
			 	
			 	<c:if test="${pageBean.pageNumber - 2 < 0}">
				  	<c:forEach begin="1" end="${pageBean.pageNumber + 2}" step="1" var="count">
				  	
				  		<c:if test="${pageBean.pageNumber == count}">
				  			<li class="active"><a href="javascript:void(0)">${count }</a></li>
				  		</c:if>
				  		<c:if test="${pageBean.pageNumber != count and count > 0 and count < pageBean.totalPage + 1}">
				  			<li><a href="${pageContext.request.contextPath }/blog/list/pageNum/${count }.html?year=${param.year}&month=${param.month}&typeId=${param.typeId}">${count }</a></li>
				  		</c:if> 
				  	</c:forEach>
				</c:if>
				<c:if test="${pageBean.pageNumber -2 >= 0}">
					<c:forEach begin="${pageBean.pageNumber - 2 }" end="${pageBean.pageNumber + 2}" step="1" var="count">
				  	
				  		<c:if test="${pageBean.pageNumber == count}">
				  			<li class="active"><a href="javascript:void(0)">${count }</a></li>
				  		</c:if>
				  		<c:if test="${pageBean.pageNumber != count and count > 0 and count < pageBean.totalPage + 1}">
				  			<li><a href="${pageContext.request.contextPath }/blog/list/pageNum/${count }.html?year=${param.year}&month=${param.month}&typeId=${param.typeId}">${count }</a></li>
				  		</c:if> 
				  	</c:forEach>
				</c:if>
			  	
			  	<c:if test="${pageBean.totalPage == pageBean.pageNumber}">
			  		<li class="disabled"><a href="javascript:void(0)">下一页</a></li>
			  	</c:if>
			  	<c:if test="${pageBean.totalPage != pageBean.pageNumber}">
			  		<li><a href="${pageContext.request.contextPath }/blog/list/pageNum/${pageBean.pageNumber + 1 }.html?year=${param.year}&month=${param.month}&typeId=${param.typeId}">下一页</a></li>
			  	</c:if>
			  	<li><a href="${pageContext.request.contextPath }/blog/list/pageNum/${pageBean.totalPage }.html?year=${param.year}&month=${param.month}&typeId=${param.typeId}">尾页</a></li>
		 	
		 	</c:if>
		  </ul>
	</nav>